//
//  ProductNameViewController.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/13.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "ProductNameViewController.h"
#import "ProductNameViewModel.h"

@interface ProductNameViewController ()<ProductNameDelegate>
@property (nonatomic,strong)ProductNameViewModel * nameViewModel;
@end

@implementation ProductNameViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    if (_publish_Type == PublishSelectList_GoodsName) {
        self.title = @"品名";
    }else if (_publish_Type == PublishSelectList_Material){
        self.title = @"材质";
    }else if (_publish_Type == PublishSelectList_Spec){
        self.title = @"规格";
    }else{
        self.title = @"钢厂";
    }
    self.nameViewModel = [[ProductNameViewModel alloc] initWithViewToViewModel:self.tableView theSuperView:self.view];
    self.nameViewModel.pub_type = _publish_Type;
    self.nameViewModel.delegate = self;
}

-(void)setPublish_Type:(PublishSelectList)publish_Type{
    _publish_Type = publish_Type;
    
}

#pragma mark -- ProductNameDelegate
-(void)productDidSelectRowAtIndexPath:(PublishListModel_Data *)p_Model{
    if (self.Block_PubModel) {
        self.Block_PubModel(p_Model);
    }
    [self.navigationController popViewControllerAnimated:YES];
}

@end
